(function () {
    function cutHex(str) {
        return (str.charAt(0) == "#") ? str.substring(1, 7) : str;
    }

    fruit.util.color = {
        hex2rgb: function (val) {
            var r, g,b ,val = cutHex(val);
            r = parseInt(val.substring(0,2),16);
            g = parseInt(val.substring(2,4),16);
            b = parseInt(val.substring(4,6),16);
            return {
                r:r,
                g:g,
                b:b
            }
        }
    }
})();
